package extends6constructor;

public class Test
{
    public static void main(String[] args) {
        //目标：认识子类构造器的特点，再看应用场景。
        //子类构造器先调用父类构造器，再调用自身构造器。（一定要先调父类再调子类）
    Zi zi = new Zi();

    }

}

class Zi extends Fu
{
    public Zi()
    {
        super(666);
        System.out.println("子类无参构造器执行了");
    }
}

class Fu
{
    public Fu()
    {
        System.out.println("父类无参构造器执行了");
    }
    public Fu(int a)
    {
        System.out.println("父类有参构造器执行了");
    }
}
